using HKB.Common;
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Diagnostics;
namespace HKB.Data.Dal.AdminGroupTableAdapters
{
	[GeneratedCode("System.Data.Design.TypedDataSetGenerator", "2.0.0.0"), DataObject(true), HelpKeyword("vs.data.TableAdapter"), Designer("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), DesignerCategory("code"), ToolboxItem(true)]
	public class HL_AdminGroupTableAdapter : Component
	{
		private SqlDataAdapter _adapter;
		private SqlConnection _connection;
		private SqlCommand[] _commandCollection;
		private bool _clearBeforeFill;
		[System.Diagnostics.DebuggerNonUserCode]
		private SqlDataAdapter Adapter
		{
			get
			{
				if (this._adapter == null)
				{
					this.InitAdapter();
				}
				return this._adapter;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		internal SqlConnection Connection
		{
			get
			{
				if (this._connection == null)
				{
					this.InitConnection();
				}
				return this._connection;
			}
			set
			{
				this._connection = value;
				if (this.Adapter.InsertCommand != null)
				{
					this.Adapter.InsertCommand.Connection = value;
				}
				if (this.Adapter.DeleteCommand != null)
				{
					this.Adapter.DeleteCommand.Connection = value;
				}
				if (this.Adapter.UpdateCommand != null)
				{
					this.Adapter.UpdateCommand.Connection = value;
				}
				for (int i = 0; i < this.CommandCollection.Length; i++)
				{
					if (this.CommandCollection[i] != null)
					{
						this.CommandCollection[i].Connection = value;
					}
				}
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		protected SqlCommand[] CommandCollection
		{
			get
			{
				if (this._commandCollection == null)
				{
					this.InitCommandCollection();
				}
				return this._commandCollection;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		public bool ClearBeforeFill
		{
			get
			{
				return this._clearBeforeFill;
			}
			set
			{
				this._clearBeforeFill = value;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		public HL_AdminGroupTableAdapter()
		{
			this.ClearBeforeFill = true;
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitAdapter()
		{
			this._adapter = new SqlDataAdapter();
			DataTableMapping dataTableMapping = new DataTableMapping();
			dataTableMapping.SourceTable = "Table";
			dataTableMapping.DataSetTable = "HL_AdminGroup";
			dataTableMapping.ColumnMappings.Add("AdminGourpID", "AdminGourpID");
			dataTableMapping.ColumnMappings.Add("AdminGroupName", "AdminGroupName");
			dataTableMapping.ColumnMappings.Add("Access", "Access");
			dataTableMapping.ColumnMappings.Add("Remark", "Remark");
			dataTableMapping.ColumnMappings.Add("Power", "Power");
			this._adapter.TableMappings.Add(dataTableMapping);
			this._adapter.DeleteCommand = new SqlCommand();
			this._adapter.DeleteCommand.Connection = this.Connection;
			this._adapter.DeleteCommand.CommandText = "DELETE FROM [HL_AdminGroup] WHERE (([AdminGourpID] = @Original_AdminGourpID))";
			this._adapter.DeleteCommand.CommandType = CommandType.Text;
			this._adapter.DeleteCommand.Parameters.Add(new SqlParameter("@Original_AdminGourpID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "AdminGourpID", DataRowVersion.Original, false, null, "", "", ""));
			this._adapter.InsertCommand = new SqlCommand();
			this._adapter.InsertCommand.Connection = this.Connection;
			this._adapter.InsertCommand.CommandText = "INSERT INTO [HL_AdminGroup] ([AdminGroupName], [Access], [Remark], [Power]) VALUES (@AdminGroupName, @Access, @Remark, @Power)";
			this._adapter.InsertCommand.CommandType = CommandType.Text;
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@AdminGroupName", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "AdminGroupName", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@Access", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "Access", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@Remark", SqlDbType.Text, 0, ParameterDirection.Input, 0, 0, "Remark", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@Power", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "Power", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand = new SqlCommand();
			this._adapter.UpdateCommand.Connection = this.Connection;
			this._adapter.UpdateCommand.CommandText = "UPDATE [HL_AdminGroup] SET [AdminGroupName] = @AdminGroupName, [Access] = @Access, [Remark] = @Remark, [Power] = @Power WHERE (([AdminGourpID] = @Original_AdminGourpID))";
			this._adapter.UpdateCommand.CommandType = CommandType.Text;
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@AdminGroupName", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "AdminGroupName", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Access", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "Access", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Remark", SqlDbType.Text, 0, ParameterDirection.Input, 0, 0, "Remark", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Power", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "Power", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Original_AdminGourpID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "AdminGourpID", DataRowVersion.Original, false, null, "", "", ""));
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitConnection()
		{
			this._connection = new SqlConnection();
			this._connection.ConnectionString = Conn.CurrenConnectionStrings;
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitCommandCollection()
		{
			this._commandCollection = new SqlCommand[7];
			this._commandCollection[0] = new SqlCommand();
			this._commandCollection[0].Connection = this.Connection;
			this._commandCollection[0].CommandText = "SELECT AdminGourpID, AdminGroupName, Access, Remark, Power\r\nFROM HL_AdminGroup";
			this._commandCollection[0].CommandType = CommandType.Text;
			this._commandCollection[1] = new SqlCommand();
			this._commandCollection[1].Connection = this.Connection;
			this._commandCollection[1].CommandText = "PR_ADDTOADMIN";
			this._commandCollection[1].CommandType = CommandType.StoredProcedure;
			this._commandCollection[1].Parameters.Add(new SqlParameter("@RETURN_VALUE", SqlDbType.Int, 4, ParameterDirection.ReturnValue, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[1].Parameters.Add(new SqlParameter("@ADDTOADMIN", SqlDbType.VarChar, 2000, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[2] = new SqlCommand();
			this._commandCollection[2].Connection = this.Connection;
			this._commandCollection[2].CommandText = "PR_DeleteAdminGroup";
			this._commandCollection[2].CommandType = CommandType.StoredProcedure;
			this._commandCollection[2].Parameters.Add(new SqlParameter("@RETURN_VALUE", SqlDbType.Int, 4, ParameterDirection.ReturnValue, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[2].Parameters.Add(new SqlParameter("@AdminGroupID", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[3] = new SqlCommand();
			this._commandCollection[3].Connection = this.Connection;
			this._commandCollection[3].CommandText = "SELECT HL_AdminGroup.AdminGroupName, HL_AdminGroup.Access, \r\n      HL_AdminGroup.Remark, HL_AdminGroup.Power, HL_Admin.Admin_ID, \r\n      HL_Admin.UserName, HL_AdminGroup.AdminGourpID\r\nFROM HL_AdminGroup INNER JOIN\r\n      HL_AdminUserGroup ON \r\n      HL_AdminGroup.AdminGourpID = HL_AdminUserGroup.GroupID INNER JOIN\r\n      HL_Admin ON HL_AdminUserGroup.AdminID = HL_Admin.Admin_ID\r\nwhere hl_adminusergroup.adminid=@AdminID";
			this._commandCollection[3].CommandType = CommandType.Text;
			this._commandCollection[3].Parameters.Add(new SqlParameter("@AdminID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "AdminID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[4] = new SqlCommand();
			this._commandCollection[4].Connection = this.Connection;
			this._commandCollection[4].CommandText = "SELECT AdminGourpID, AdminGroupName, Access, Remark, Power\r\nFROM HL_AdminGroup\r\nWHERE (AdminGourpID = @AdminGourpID)";
			this._commandCollection[4].CommandType = CommandType.Text;
			this._commandCollection[4].Parameters.Add(new SqlParameter("@AdminGourpID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "AdminGourpID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5] = new SqlCommand();
			this._commandCollection[5].Connection = this.Connection;
			this._commandCollection[5].CommandText = "PR_INSERTAdminGroup";
			this._commandCollection[5].CommandType = CommandType.StoredProcedure;
			this._commandCollection[5].Parameters.Add(new SqlParameter("@RETURN_VALUE", SqlDbType.Int, 4, ParameterDirection.ReturnValue, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@AdminGroupName", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@Access", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@Remark", SqlDbType.Text, 2147483647, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@Power", SqlDbType.VarChar, 500, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[6] = new SqlCommand();
			this._commandCollection[6].Connection = this.Connection;
			this._commandCollection[6].CommandText = "PR_UpdateAdminGroup";
			this._commandCollection[6].CommandType = CommandType.StoredProcedure;
			this._commandCollection[6].Parameters.Add(new SqlParameter("@RETURN_VALUE", SqlDbType.Int, 4, ParameterDirection.ReturnValue, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[6].Parameters.Add(new SqlParameter("@AdminGroupName", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[6].Parameters.Add(new SqlParameter("@Access", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[6].Parameters.Add(new SqlParameter("@Remark", SqlDbType.Text, 2147483647, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[6].Parameters.Add(new SqlParameter("@Power", SqlDbType.VarChar, 500, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[6].Parameters.Add(new SqlParameter("@AdminGourpID", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[6].Parameters.Add(new SqlParameter("@UpdateAdmin", SqlDbType.Text, 2147483647, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
		}
		[DataObjectMethod(DataObjectMethodType.Select, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual AdminGroup.HL_AdminGroupDataTable GetAllAdminGruop()
		{
			this.Adapter.SelectCommand = this.CommandCollection[0];
			AdminGroup.HL_AdminGroupDataTable hL_AdminGroupDataTable = new AdminGroup.HL_AdminGroupDataTable();
			this.Adapter.Fill(hL_AdminGroupDataTable);
			return hL_AdminGroupDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual AdminGroup.HL_AdminGroupDataTable GetAdminGroupByAdminID(int? AdminID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[3];
			if (AdminID.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[0].Value = AdminID.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[0].Value = System.DBNull.Value;
			}
			AdminGroup.HL_AdminGroupDataTable hL_AdminGroupDataTable = new AdminGroup.HL_AdminGroupDataTable();
			this.Adapter.Fill(hL_AdminGroupDataTable);
			return hL_AdminGroupDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual AdminGroup.HL_AdminGroupDataTable GetGroupByGroupID(int AdminGourpID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[4];
			this.Adapter.SelectCommand.Parameters[0].Value = AdminGourpID;
			AdminGroup.HL_AdminGroupDataTable hL_AdminGroupDataTable = new AdminGroup.HL_AdminGroupDataTable();
			this.Adapter.Fill(hL_AdminGroupDataTable);
			return hL_AdminGroupDataTable;
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(AdminGroup.HL_AdminGroupDataTable dataTable)
		{
			return this.Adapter.Update(dataTable);
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(AdminGroup dataSet)
		{
			return this.Adapter.Update(dataSet, "HL_AdminGroup");
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(DataRow dataRow)
		{
			return this.Adapter.Update(new DataRow[]
			{
				dataRow
			});
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(DataRow[] dataRows)
		{
			return this.Adapter.Update(dataRows);
		}
		[DataObjectMethod(DataObjectMethodType.Delete, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Delete(int Original_AdminGourpID)
		{
			this.Adapter.DeleteCommand.Parameters[0].Value = Original_AdminGourpID;
			ConnectionState state = this.Adapter.DeleteCommand.Connection.State;
			if ((this.Adapter.DeleteCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				this.Adapter.DeleteCommand.Connection.Open();
			}
			int result;
			try
			{
				int num = this.Adapter.DeleteCommand.ExecuteNonQuery();
				result = num;
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					this.Adapter.DeleteCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Insert, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Insert(string AdminGroupName, int? Access, string Remark, string Power)
		{
			if (AdminGroupName == null)
			{
				this.Adapter.InsertCommand.Parameters[0].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[0].Value = AdminGroupName;
			}
			if (Access.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[1].Value = Access.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[1].Value = System.DBNull.Value;
			}
			if (Remark == null)
			{
				this.Adapter.InsertCommand.Parameters[2].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[2].Value = Remark;
			}
			if (Power == null)
			{
				this.Adapter.InsertCommand.Parameters[3].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[3].Value = Power;
			}
			ConnectionState state = this.Adapter.InsertCommand.Connection.State;
			if ((this.Adapter.InsertCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				this.Adapter.InsertCommand.Connection.Open();
			}
			int result;
			try
			{
				int num = this.Adapter.InsertCommand.ExecuteNonQuery();
				result = num;
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					this.Adapter.InsertCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Update, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(string AdminGroupName, int? Access, string Remark, string Power, int Original_AdminGourpID)
		{
			if (AdminGroupName == null)
			{
				this.Adapter.UpdateCommand.Parameters[0].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[0].Value = AdminGroupName;
			}
			if (Access.HasValue)
			{
				this.Adapter.UpdateCommand.Parameters[1].Value = Access.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[1].Value = System.DBNull.Value;
			}
			if (Remark == null)
			{
				this.Adapter.UpdateCommand.Parameters[2].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[2].Value = Remark;
			}
			if (Power == null)
			{
				this.Adapter.UpdateCommand.Parameters[3].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[3].Value = Power;
			}
			this.Adapter.UpdateCommand.Parameters[4].Value = Original_AdminGourpID;
			ConnectionState state = this.Adapter.UpdateCommand.Connection.State;
			if ((this.Adapter.UpdateCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				this.Adapter.UpdateCommand.Connection.Open();
			}
			int result;
			try
			{
				int num = this.Adapter.UpdateCommand.ExecuteNonQuery();
				result = num;
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					this.Adapter.UpdateCommand.Connection.Close();
				}
			}
			return result;
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int ADDTOADMIN(string ADDTOADMIN1)
		{
			SqlCommand sqlCommand = this.CommandCollection[1];
			if (ADDTOADMIN1 == null)
			{
				sqlCommand.Parameters[1].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[1].Value = ADDTOADMIN1;
			}
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int DeleteAdminGroup(int? AdminGroupID)
		{
			SqlCommand sqlCommand = this.CommandCollection[2];
			if (AdminGroupID.HasValue)
			{
				sqlCommand.Parameters[1].Value = AdminGroupID.Value;
			}
			else
			{
				sqlCommand.Parameters[1].Value = System.DBNull.Value;
			}
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual object INSERTAdminGroup(string AdminGroupName, int? Access, string Remark, string Power)
		{
			SqlCommand sqlCommand = this.CommandCollection[5];
			if (AdminGroupName == null)
			{
				sqlCommand.Parameters[1].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[1].Value = AdminGroupName;
			}
			if (Access.HasValue)
			{
				sqlCommand.Parameters[2].Value = Access.Value;
			}
			else
			{
				sqlCommand.Parameters[2].Value = System.DBNull.Value;
			}
			if (Remark == null)
			{
				sqlCommand.Parameters[3].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[3].Value = Remark;
			}
			if (Power == null)
			{
				sqlCommand.Parameters[4].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[4].Value = Power;
			}
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			object obj;
			try
			{
				obj = sqlCommand.ExecuteScalar();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			object result;
			if (obj == null || obj.GetType() == typeof(System.DBNull))
			{
				result = null;
			}
			else
			{
				result = obj;
			}
			return result;
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int UpdateAdminGroup(string AdminGroupName, int? Access, string Remark, string Power, int? AdminGourpID, string UpdateAdmin)
		{
			SqlCommand sqlCommand = this.CommandCollection[6];
			if (AdminGroupName == null)
			{
				sqlCommand.Parameters[1].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[1].Value = AdminGroupName;
			}
			if (Access.HasValue)
			{
				sqlCommand.Parameters[2].Value = Access.Value;
			}
			else
			{
				sqlCommand.Parameters[2].Value = System.DBNull.Value;
			}
			if (Remark == null)
			{
				sqlCommand.Parameters[3].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[3].Value = Remark;
			}
			if (Power == null)
			{
				sqlCommand.Parameters[4].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[4].Value = Power;
			}
			if (AdminGourpID.HasValue)
			{
				sqlCommand.Parameters[5].Value = AdminGourpID.Value;
			}
			else
			{
				sqlCommand.Parameters[5].Value = System.DBNull.Value;
			}
			if (UpdateAdmin == null)
			{
				sqlCommand.Parameters[6].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[6].Value = UpdateAdmin;
			}
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
	}
}
